{extend name='common/content' /}

{block name="button"}
<!--{if auth("$classuri/add")}-->
<!-- <button data-modal='{:url("$classuri/add")}' data-title="添加" class='layui-btn layui-btn-sm layui-btn-primary'>添加</button> -->
<!--{/if}-->

<!--{if auth("$classuri/del")}-->
<!-- <button data-update data-field='delete' data-action='{:url("$classuri/del")}' class='layui-btn layui-btn-sm layui-btn-primary'>删除</button> -->
<!--{/if}-->
{/block}

{block name="content"}

<!-- 表单搜索 开始 -->
<form autocomplete="off" class="layui-form layui-form-pane form-search" action="{:request()->url()}" onsubmit="return false" method="get">

<!--     <div class="layui-form-item layui-inline">
        <label class="layui-form-label">标题</label>
        <div class="layui-input-inline">
            <input name="title" value="{$Think.get.title|default=''}" placeholder="请输入标题" class="layui-input">
        </div>
    </div> -->

    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">名称</label>
        <div class="layui-input-inline">
            <input name="keyword" value="{$Think.get.keyword|default=''}" placeholder="请输入查询人姓名或产品名称" class="layui-input">
        </div>
    </div>

    <!--{if !empty($areaList)}-->
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label" style="width:auto">所属地区</label>
        <div class="layui-input-inline">
            <select name='aid' class='layui-select'>
                <option value="">所属地区</option>
                {foreach $areaList as $val}
                {eq name='val.area_id' value='$Think.get.aid|default=0'}
                <option selected  value='{$val.area_id}'>{$val.spl}{$val.area_name}</option>
                {else/}
                <option  value='{$val.area_id}'>{$val.spl}{$val.area_name}</option>
                {/eq}
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

    <!--{if !empty($roles)}-->
    <div class="layui-form-item layui-inline">
        <label class="layui-form-label">角色</label>
        <div class="layui-input-inline">
            <select name="role" lay-search>
                <option value="">请选择角色</option>
                {foreach $roles as $role}
                <!--{if $Think.get.role eq $role.id}-->
                <option selected="selected" value="{$role.id}">{$role.title}</option>
                <!--{else}-->
                <option value="{$role.id}">{$role.title}</option>
                <!--{/if}-->
                {/foreach}
            </select>
        </div>
    </div>
    <!--{/if}-->

<!--     <div class="layui-form-item layui-inline">
        <label class="layui-form-label">时间</label>
        <div class="layui-input-inline">
            <input name="date" id='range-date' value="{$Think.get.date|default=''}" placeholder="请选择时间" class="layui-input">
        </div>
    </div> -->

    <div class="layui-form-item layui-inline">
        <button class="layui-btn layui-btn-primary"><i class="layui-icon">&#xe615;</i> 搜 索</button>
    </div>

</form>
<script>
    window.laydate.render({range: true, elem: '#range-date'});
</script>
<!-- 表单搜索 结束 -->

<form onsubmit="return false;" data-auto="true" method="post">
    <!--{empty name='list'}-->
    <p class="help-block text-center well">没 有 记 录 哦！</p>
    <!--{else}-->
    <input type="hidden" value="resort" name="action">
    <table class="layui-table" lay-skin="line">
        <thead>
        <tr>
            <th class='text-left nowrap'>查询产品</th>
            <th class='text-left nowrap'>查询人</th>
            <th class='text-left nowrap'>查询次数</th>
            <th class='text-left nowrap'>最后查询时间</th>
            <th class='text-left nowrap'>首次查询时间</th>
        </tr>
        </thead>
        <tbody>
        <!--{foreach $list as $key=>$vo}-->
        <tr>
            <td class='text-left nowrap'>
                {$vo.pid|get_model_value='product','title'|default="<span class='color-desc'>未设置</span>"|raw}
            </td>
            <td class='text-left nowrap'>
                {$vo.uid|get_model_value='member','nickname'|default="<span class='color-desc'>未设置</span>"|raw}
                ({$vo.aid|join_area_name|default="<span class='color-desc'>未设置</span>"|raw})
            </td>
            <td class='text-left nowrap'>{$vo.trace_num|default=0}</td>
            <td class='text-left nowrap'>
                {$vo.update_at|date='Y-m-d H:i:s'}
            </td>
            <td class='text-left nowrap'>
                {$vo.create_at|date='Y-m-d H:i:s'|default="<span class='color-desc'>从未查询</span>"|raw}
            </td>
        </tr>
        <!--{/foreach}-->
        </tbody>
    </table>
    {if isset($page)}<p>{$page|raw}</p>{/if}
    <!--{/empty}-->
</form>
<script>
    (function () {
        window.form.render();
        window.laydate.render({range: true, elem: '#create_at'});
    })();
</script>
{/block}